import body from '@/components/body'
import childView from '@/components/appMain.vue'

const templateTree = resolve => {
  require(['@/views/interface/template/tree.vue'], resolve)
}; //
const templateList = resolve => {
  require(['@/views/interface/template/list.vue'], resolve)
}; //
const templateEdit = resolve => {
  require(['@/views/interface/template/edit.vue'], resolve)
}; //
const templateReName = resolve => {
  require(['@/views/interface/template/rename.vue'], resolve)
}; //
const templateSetting = resolve => {
  require(['@/views/interface/template/setting.vue'], resolve)
}; //
const resourceTree = resolve => {
  require(['@/views/interface/resource/tree.vue'], resolve)
}; //
const resourceList = resolve => {
  require(['@/views/interface/resource/list.vue'], resolve)
}; //
const resourceEdit = resolve => {
  require(['@/views/interface/resource/edit.vue'], resolve)
}; //
const resourceReName = resolve => {
  require(['@/views/interface/resource/rename.vue'], resolve)
}; //
const dataCenterRouter = {
  path: "/dataCenter",
  name: '数据中心',//数据中心
  component: body,
  iconCls: 'icon-barschart',
  meta: {
    isLink: true,
  },
  children: [
    {
      path: '/traffic',//流量分析
      name: '流量统计',
      component: childView,
      redirect: '/traffic/trend',
      children: [{
        path: '/traffic/trend',//趋势分析
        name: '到馆率分析',
        component: resolve => {
          require(['@/views/data/trendAnalysis.vue'], resolve)
        },
      }, {
        path: '/traffic/channel',//栏目访问量排行
        name: '栏目访问量排行',
        component: resolve => {
          require(['@/views/data/channelAnalysis.vue'], resolve)
        },
      }]
    },
    {
      path: '/sourceanalysis',//来源分析
      name: '来源分析',
      component: childView,
      children: [{
        path: '/sourceanalysis/class',//来源分类
        name: '来源分类',
        component: resolve => {
          require(['@/views/data/source/class.vue'], resolve)
        },
      },
        {
          path: '/sourceanalysis/engin',//搜索引擎
          name: '搜索引擎',
          component: resolve => {
            require(['@/views/data/source/engine.vue'], resolve)
          },
        },
        {
          path: '/sourceanalysis/domain',//来访域名
          name: '来访域名',
          component: resolve => {
            require(['@/views/data/source/domain.vue'], resolve)
          },
        },
        {
          path: '/sourceanalysis/city',//来访域名
          name: '来访地区',
          component: resolve => {
            require(['@/views/data/source/city.vue'], resolve)
          },
        },
        {
          path: '/sourceanalysis/keywords',//搜索词
          name: '搜索词',
          component: resolve => {
            require(['@/views/data/source/keywords.vue'], resolve)
          },
        }]
    },
    {
      path: '/surveyedanalysis',//受访分析
      name: '受访分析',
      component: childView,
      children: [{
        path: '/surveyedanalysis/surveyed',//受访页面
        name: '受访页面',
        component: resolve => {
          require(['@/views/data/surveyed/surveyed.vue'], resolve)
        },
      },
        {
          path: '/surveyedanalysis/index',//入口页面
          name: '入口页面',
          component: resolve => {
            require(['@/views/data/surveyed/index.vue'], resolve)
          },
        }]
    },
    {
      path: '/loyalty',//忠诚度
      name: '忠诚度',
      isParent: true,
      component: resolve => {
        require(['@/views/data/loyalty.vue'], resolve)
      },
    },
    {
      path: '/siteProfile',//网站概况
      name: '网站概况',
      component: childView,
      children: [{
        path: '/siteProfile/contentnum',//内容发布数
        name: '内容发布数',
        component: resolve => {
          require(['@/views/data/siteProfile/contentnum.vue'], resolve)
        },
      },
        {
          path: '/siteProfile/worknum',//工作量
          name: '工作量',
          component: resolve => {
            require(['@/views/data/siteProfile/worknum.vue'], resolve)
          },
        },
        {
          path: '/siteProfile/commentnum',//评论数
          name: '评论数',
          component: resolve => {
            require(['@/views/data/siteProfile/commentnum.vue'], resolve)
          },
        },
        {
          path: '/siteProfile/leavenum',//留言数
          name: '留言数',
          component: resolve => {
            require(['@/views/data/siteProfile/leavenum.vue'], resolve)
          },
        },
        {
          path: '/siteProfile/usernum',//用户注册数
          name: '用户注册数',
          component: resolve => {
            require(['@/views/data/siteProfile/usernum.vue'], resolve)
          },
        }
      ]
    }]
}
export default dataCenterRouter
